import Vue from 'vue'
import VueRouter from 'vue-router'

// 登陆页面
import Login from '@/views/login/index.vue'
// 文章详情页
import Detail from '@/views/detail/index.vue'
// 首页
import Layout from '@/views/layout/index.vue'
// 首页
import Home from '@/views/home/index.vue'
// 分类页
import Classfly from '@/views/classfly/index.vue'
// 购物车
import Shopping from '@/views/shopping/index.vue'
// 我的
import My from '@/views/my/index.vue'


Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    // 登陆
    { path: '/login', component: Login},
    // 文章详情页
    { path: '/detail', component: Detail},
    // 首页
    { 
      path: '/', 
      redirect: '/home',
      component: Layout,
      children: [
        {path: 'home', component: Home},
        {path: 'classfly', component: Classfly},
        {path: 'shopping', component: Shopping},
        {path: 'my', component: My},

      ]
    },
   
  ]
})

export default router
